home *** CD-ROM | disk | FTP | other *** search
- #if !defined(AFX_GNUTRANSFER_H__3C289740_2843_11D4_ACF2_00A0CC533D52__INCLUDED_)
- #define AFX_GNUTRANSFER_H__3C289740_2843_11D4_ACF2_00A0CC533D52__INCLUDED_
-
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- // GnuTransfer.h : header file
- //
-
-
-
- /////////////////////////////////////////////////////////////////////////////
- // CGnuTransfer command target
-
- // Seperate thread
- class CGnuTransfer : public CAsyncSocket
- {
- DECLARE_DYNCREATE(CGnuTransfer)
-
- // Attributes
- public:
- int Handle;
- CString Status;
- char Type;
- bool IsTransfering;
- CString ClientName;
-
- CFile File;
- DWORD FileSize;
- QueryItem FileInfo;
-
- DWORD BytesCompleted;
- DWORD OldBytesCompleted;
- float OldRate;
-
- DWORD AllocBw;
-
- CGnuControl *GnuComm;
-
- // Operations
- public:
- CGnuTransfer();
- CGnuTransfer(CGnuControl *);
- virtual ~CGnuTransfer();
-
- static void SendFile(void *);
-
- void Pause();
- void Resume();
-
- void StartSending();
- bool IsFileOpen;
- HANDLE m_threadHandle;
-
- // Link to next CGnuTransfer node in the list
- CGnuTransfer *next;
-
- // Overrides
- public:
- DWORD m_dwBytesIn; // for one period only
- DWORD m_dwBytesOut; // for one period only
- DWORD m_dwTotalBytesIn;
- DWORD m_dwTotalBytesOut;
- DWORD m_dwByteAllottmentOut;
- DWORD m_dwByteAllottmentIn;
- DWORD GetSecondsSinceLastContact(void)
- {return ( CTime::GetCurrentTime() - m_timeLastHeardAT ).GetTotalSeconds();}
-
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CGnuTransfer)
- public:
- virtual void OnConnect(int nErrorCode);
- virtual void OnReceive(int nErrorCode);
- virtual void OnClose(int nErrorCode);
- //}}AFX_VIRTUAL
-
- // Generated message map functions
- //{{AFX_MSG(CGnuTransfer)
- // NOTE - the ClassWizard will add and remove member functions here.
- //}}AFX_MSG
-
- // Implementation
- protected:
- void WantToDisconnect();
- Initialize();
-
- CWinThread *SendFileThread;
-
- CTime m_timeLastHeardAT; // hold time of last contact, for expiring non responding hosts.
- };
-
-
-
- /////////////////////////////////////////////////////////////////////////////
-
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
- #endif // !defined(AFX_GNUTRANSFER_H__3C289740_2843_11D4_ACF2_00A0CC533D52__INCLUDED_)
-